var events = require('events')//原生模块
var Emitter = events.EventEmitter;//构造函数，进行一个对象的实例化
var eventObj = new Emitter();//对象的实例化
eventObj.on('sayhello',function(){
    console.log('Hello World')
});//做事件监听，写事件名字
setTimeout(()=>{
    eventObj.emit('sayhello');
},3000)